<template>
  <div>
    <el-form :inline="true" :model="formInline" class="demo-form-inline" @keyup.enter.native="search()">
      <!-- <el-row :span="24"> -->
      <el-form-item label="商品名称">
        <br />
        <br />
        <el-input v-model="formInline.goodsName" clearable placeholder style="margin-left: -80px; width: 200px">
        </el-input>
      </el-form-item>
      <el-form-item label="商品分类" style="margin-left: 15px">
        <br />
        <br />
        <el-select v-model="formInline.goodsTypeId" clearable style="margin-left: -80px; width: 200px">
          <el-option v-for="(send, i) in typeData" :key="i" :value="send.goodsTypeId" :label="send.goodsTypeName">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="状态" style="margin-left: 40px">
        <br />
        <br />
        <el-select v-model="formInline.customizeStatus" clearable style="margin-left: -80px; width: 200px">
          <el-option v-for="(send, i) in customizeStatusData" :key="i" :value="send.id" :label="send.name"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item style="margin-left: 850px; text-align: right">
        <el-button type="primary" @click="search()" size="mini" icon="el-icon-search">查询</el-button>

        <el-button type="primary" @click="kong()" size="mini" icon="el-icon-delete">清空</el-button>

        <!-- </el-row> -->
        <!-- <el-row :span="24">
        <el-col :span="24"> -->
        <el-button type="primary" @click="showGoodsDialog()" size="mini" icon="el-icon-plus">添加定制酒</el-button>
      </el-form-item>
      <!-- </el-col>
      </el-row> -->
    </el-form>
    <div class="table1">
      <el-table ref="table1" tooltip-effect="dark" style="width: 100%" v-loading="loading" :data="tableData" border
        :header-cell-style="{ background: '#eef1f6', color: '#606266' }">
        <el-table-column type="index" label="序号" align="center" width="60"></el-table-column>
        <el-table-column v-for="(item, index) in col" :key="`col_${index}`" :prop="dropCol[index].prop"
          :width="dropCol[index].width" :label="item.label" align="center">
          <template slot-scope="scope">
            <div v-if="dropCol[index].prop === 'goodsPic'">
              <img :src="scope.row.goodsPic" v-if="
                                    scope.row.goodsPic != '' &&
                                    scope.row.goodsPic != null
                                " width="70" height="50" />
            </div>
            <div v-if="dropCol[index].prop === 'picList'">
              <img :src="scope.row.picList[0].picUrl" v-if="
                                    scope.row.picList != null &&
                                    getLength(scope.row.picList) > 0
                                " width="70" height="50" @click="showUploadPicDialog(scope.row)" title="点击上传" />
              <el-button size="mini" type="primary" title="点击上传" @click="showUploadPicDialog(scope.row)" v-if="
                                    scope.row.picList == null ||
                                    getLength(scope.row.picList) == 0
                                ">上传</el-button>
            </div>
            <div v-if="dropCol[index].prop === 'customizePrice'">
              <span v-if="scope.row.customizePrice != null">
                <el-button size="mini" @click="showCustomizePriceDialog(scope.row)" type="text">{{
                                        scope.row.customizePrice.toFixed(2)
                                    }}</el-button>
              </span>
              <el-button size="mini" type="primary" title="填写定制费用" @click="showCustomizePriceDialog(scope.row)"
                v-if="scope.row.customizePrice == null">填写定制费用</el-button>
            </div>
            <div v-if="dropCol[index].prop === 'customizeStatus'">
              <span v-if="scope.row.customizeStatus == 0">禁用</span>
              <span v-if="scope.row.customizeStatus == 1">启用</span>
            </div>
            <div v-if="
                                dropCol[index].prop != 'goodsPic' &&
                                dropCol[index].prop != 'picList' &&
                                dropCol[index].prop != 'customizePrice' &&
                                dropCol[index].prop != 'customizeStatus'
                            ">
              {{ scope.row[dropCol[index].prop] }}
            </div>
          </template>
        </el-table-column>
        <!--
        <el-table-column prop="goodsSeq" label="商品编号" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="goodsName" label="商品名称" align="center" show-overflow-tooltip></el-table-column>
        <el-table-column prop="goodsTypeName" label="分类名称" align="center" width="150" show-overflow-tooltip></el-table-column>
        <el-table-column prop="unitName" label="计量单位" align="center" width="100"></el-table-column>
        <el-table-column prop="goodsPic" label="图片" align="center" width="150">
          <template slot-scope="scope" width="250">
              <img
                :src="scope.row.goodsPic"
                v-if="scope.row.goodsPic !='' && scope.row.goodsPic !=null"
                width="70"
                height="50"
              />
          </template>
        </el-table-column>
        <el-table-column prop="goodsPic" label="经典案例图片" align="center" width="150">
          <template slot-scope="scope">
              <img
                :src="scope.row.picList[0].picUrl"
                v-if="scope.row.picList !=null && getLength(scope.row.picList) > 0"
                width="70"
                height="50"
                @click="showUploadPicDialog(scope.row)"
                title="点击上传"
              />
              <el-button size="mini" 
                type="primary"
                title="点击上传"
                @click="showUploadPicDialog(scope.row)" 
                v-if="scope.row.picList ==null || getLength(scope.row.picList) == 0">上传</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="customizeStatus" label="状态" align="center" width="100" show-overflow-tooltip>
          <template slot-scope="scope">
            <span v-if="scope.row.customizeStatus == 0">禁用</span>
            <span v-if="scope.row.customizeStatus == 1">启用</span>
          </template>
        </el-table-column>
        -->
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <el-button size="mini" @click="updateCustomizeStatus(scope.row, 0)" type="text"
              v-if="scope.row.customizeStatus == 1">禁用</el-button>
            <el-button size="mini" @click="updateCustomizeStatus(scope.row, 1)" type="text"
              v-if="scope.row.customizeStatus == 0">启用</el-button>
            <el-button size="mini" @click="deleteCustomizeGoods(scope.row)" type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-form :inline="true">
        <el-form-item style="margin-top: 0px"></el-form-item>
      </el-form>
      <div class="block" style="margin-top: -22px">
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :page-sizes="[10, 20, 30, 50, 100, 150, 200]" :current-page="listQuery.current" :page-size="listQuery.size"
          layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
      </div>
    </div>

    <!--上传经典案例图片弹窗-->
    <el-dialog title="上传图片" :visible.sync="uploadPicDialogVisible" width="31%">
      <div>
        <el-form :inline="true" class="demo-form-inline">
          <el-row>
            <el-col style="margin: 10px; 0px; 10px; 0">
              <el-upload style="margin: 10px" :action="action" :on-preview="handlePreview" :on-remove="handleRemove"
                :file-list="picList" :on-success="upLoadPic" list-type="picture-card" :headers="headers">
                <i class="el-icon-plus"></i>
              </el-upload>
              <p class="tips" style="margin-left: 10px">
                注：上传图片(限30M)
              </p>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="24" style="text-align: center; margin-top: 30px">
              <el-button type="info" @click="closeUploadPicDialog()" size="mini">取 消</el-button>
              <el-button type="primary" @click="insertPictures()" size="mini">确 认</el-button>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </el-dialog>

    <!--图片预览弹窗-->
    <el-dialog :visible.sync="dialogVisibleImg" size="tiny">
      <img width="100%" :src="dialogImageUrl" alt />
    </el-dialog>

    <!--上传经典案例图片弹窗-->
    <el-dialog title="填写定制费用" :visible.sync="customizePriceDialogVisible" width="31%"
      @close="closeCustomizePriceDialog()">
      <div>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="0" class="demo-ruleForm">
          <el-form-item prop="customizePrice" style="width: 300px; margin: 0 auto">
            <el-input v-model="ruleForm.customizePrice" type="number" oninput="value=value.replace(/[^0-9.]/g,'')"
              class="input_edit" style="text-align-last: right" placeholder="请输入定制费用" v-on:blur="customizePriceCheck()">
              <template slot="prepend">每{{ priceGoodsUnit }}</template>
              <template slot="append">元</template>
            </el-input>
          </el-form-item>
          <el-row>
            <el-col :span="24" style="text-align: center; margin-top: 30px">
              <el-button type="info" @click="closeCustomizePriceDialog()" size="mini">取 消</el-button>
              <el-button type="primary" @click="saveCustomizePrice()" size="mini">确 认</el-button>
            </el-col>
          </el-row>
        </el-form>
      </div>
    </el-dialog>
    <!--添加定制酒弹窗-->
    <el-dialog title="添加定制酒" :visible.sync="insertGoodsDialogVisible" width="60%">
      <div>
        <el-form :inline="true" :model="formInline2" class="demo-form-inline">
          <el-row :span="24">
            <el-col :span="24">
              <el-form-item label="商品名称">
                <el-input v-model="formInline2.goodsName" clearable placeholder style="width: 200px"></el-input>
              </el-form-item>
              <el-form-item label="商品分类">
                <el-select v-model="formInline2.goodsTypeId" clearable>
                  <el-option v-for="(send, i) in typeData" :key="i" :value="send.goodsTypeId"
                    :label="send.goodsTypeName"></el-option>
                </el-select>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="search2()" size="mini" icon="el-icon-search">查询</el-button>
              </el-form-item>
              <el-form-item>
                <el-button type="primary" @click="kong2()" size="mini" icon="el-icon-delete">清空</el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="table2">
          <el-table ref="table2" tooltip-effect="dark" style="width: 100%" v-loading="loading2" :data="chooseData"
            @selection-change="handleSelectionChange" border :header-cell-style="{
                            background: '#eef1f6',
                            color: '#606266',
                        }">
            <el-table-column type="selection" width="60" align="center" fixed disabled></el-table-column>
            <el-table-column prop="goodsSeq" label="商品编号" align="center" width="150" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="goodsName" label="商品名称" align="center" show-overflow-tooltip></el-table-column>
            <el-table-column prop="goodsTypeName" label="分类名称" align="center" width="150" show-overflow-tooltip>
            </el-table-column>
            <el-table-column prop="unitName" label="计量单位" align="center" width="100"></el-table-column>
            <el-table-column prop="goodsPic" label="图片" align="center" width="150">
              <template slot-scope="scope">
                <img :src="scope.row.goodsPic" v-if="
                                        scope.row.goodsPic != '' &&
                                        scope.row.goodsPic != null
                                    " width="70" height="50" />
              </template>
            </el-table-column>
          </el-table>
          <div class="block" style="margin-top: 22px; overflow: hidden">
            <el-pagination @size-change="handleSizeChange2" @current-change="handleCurrentChange2"
              :page-sizes="[5, 10, 20, 30, 50, 100, 150, 200]" :current-page="listQuery2.current"
              :page-size="listQuery2.size" layout="total, sizes, prev, pager, next, jumper" :total="total2">
            </el-pagination>
          </div>
          <el-row>
            <el-col :span="24" style="text-align: center; margin-top: 30px">
              <el-button type="info" @click="closeGoodsDialog()" size="mini">取 消</el-button>
              <el-button type="primary" @click="insertCustomizeGoods()" size="mini">确 认</el-button>
            </el-col>
          </el-row>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import Sortable from 'sortablejs';
  import {
    queryGoodsCategorys
  } from "@/api/warProductmanage";
  import {
    queryCustomizeGoodsList,
    queryCustomizeGoodsAllList,
    queryChooseGoodsList,
    queryCustomizePicList,
    deleteCustomizeGoods,
    updateCustomizeStatus,
    batchInsertCustomizeGoods,
    insertCustomizePictures,
    saveCustomizePrice
  } from "@/api/goodsCustomize";
  import qs from "qs";

  const isMoney = function(rule, value, callback) {
    const reg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/;
    if (!value) {
      return callback(new Error("金额不能为空"));
    } else if (!reg.test(value)) {
      return callback(new Error("金额格式错误"));
    } else if (value <= 0) {
      return callback(new Error("金额不能小于等于0"));
    } else {
      callback();
    }
  };

  export default {
    data() {
      return {
        action: `${process.env.VUE_APP_BASE_API}/api/file-service/v1/file/uploadFile`,
        headers: {
          token: localStorage.getItem("token") //从cookie里获取token，并赋值  Authorization ，而不是token
        }, //上传图片用
        typeData: [], //商品类型
        customizeStatusData: [{
          id: '0',
          name: '禁用'
        }, {
          id: '1',
          name: '启用'
        }], //定制状态
        col: [{
            label: '商品编号',
            prop: 'goodsSeq',
            width: ""
          },
          {
            label: '商品名称',
            prop: 'goodsName',
            width: ""
          },
          {
            label: '分类名称',
            prop: 'goodsTypeName',
            width: "150"
          },
          {
            label: '计量单位',
            prop: 'unitName',
            width: "150"
          },
          {
            label: '图片',
            prop: 'goodsPic',
            width: "150"
          },
          {
            label: '经典案例图片',
            prop: 'picList',
            width: "150"
          },
          {
            label: '定制服务费（元）',
            prop: 'customizePrice',
            width: "150"
          },
          {
            label: '状态',
            prop: 'customizeStatus',
            width: "100"
          }
        ],
        dropCol: [{
            label: '商品编号',
            prop: 'goodsSeq',
            width: ""
          },
          {
            label: '商品名称',
            prop: 'goodsName',
            width: ""
          },
          {
            label: '分类名称',
            prop: 'goodsTypeName',
            width: "150"
          },
          {
            label: '计量单位',
            prop: 'unitName',
            width: "150"
          },
          {
            label: '图片',
            prop: 'goodsPic',
            width: "150"
          },
          {
            label: '经典案例图片',
            prop: 'picList',
            width: "150"
          },
          {
            label: '定制服务费（元）',
            prop: 'customizePrice',
            width: "150"
          },
          {
            label: '状态',
            prop: 'customizeStatus',
            width: "100"
          }
        ],
        formInline: {
          goodsName: "",
          goodsTypeId: "",
          customizeStatus: ""
        }, //查询1
        loading: true,
        loading2: true,
        total: 0,
        total2: 0,
        listQuery: {
          current: 1,
          size: 100
        },
        listQuery2: {
          current: 1,
          size: 5
        },
        sort: "",
        order: "",
        tableData: [], //表1数据
        chooseData: [], //表2数据
        uploadPicDialogVisible: false,
        insertGoodsDialogVisible: false,
        customizePriceDialogVisible: false,
        dialogVisibleImg: false,
        dialogImageUrl: "",
        formInline2: {
          goodsName: "",
          goodsTypeId: ""
        }, //查询2
        batchSelGoods: [], //记录挑选多选商品id
        picGoodsId: "", //上传图片用
        picList: [], //上传图片用
        priceGoodsId: "", //修改定制价格用
        priceGoodsUnit: "", //修改定制价格用
        ruleForm: {
          customizePrice: null, //修改定制价格用
        },
        rules: {
          customizePrice: [{
              required: true,
              message: "请输入定制单价",
              trigger: "blur"
            },
            {
              validator: isMoney,
              trigger: "blur"
            }
          ],
        },
      };
    },
    created() {
      this.getProductType(); //获取商品分类列表
    },
    mounted() {
      this.queryCustomizeGoodsAllList(); //获取定制商品列表
      document.body.ondrop = function(event) {
        event.preventDefault();
        event.stopPropagation();
      };
      // this.rowDrop()
      this.columnDrop();
    },
    watch: {},
    methods: {
      //拖拽列表
      columnDrop() {
        const wrapperTr = document.querySelector('.el-table__header-wrapper tr');
        this.sortable = Sortable.create(wrapperTr, {
          animation: 180,
          delay: 0,
          onEnd: evt => {
            const oldItem = this.dropCol[evt.oldIndex - 1];
            this.dropCol.splice(evt.oldIndex - 1, 1);
            this.dropCol.splice(evt.newIndex - 1, 0, oldItem);
          }
        });
      },
      //获取商品分类列表
      getProductType(v) {
        let data = {};
        queryGoodsCategorys(data).then(res => {
          this.typeData = res.records;
        });
      },
      //获取定制商品列表
      queryCustomizeGoodsAllList() {
        let data = {
          current: this.listQuery.current,
          size: this.listQuery.size,
          condition: this.formInline
        }
        queryCustomizeGoodsList(data).then(res => {
          this.loading = false;
          this.tableData = res.records;
          this.total = res.total;
        });
      },
      handleSizeChange(val) {
        this.listQuery.size = val;
        this.queryCustomizeGoodsAllList();
      },
      handleCurrentChange(val) {
        this.listQuery.current = val;
        this.queryCustomizeGoodsAllList();
      },
      //查询
      search() {
        this.listQuery.current = 1;
        this.queryCustomizeGoodsAllList();
      },
      //重置
      kong() {
        this.formInline.goodsName = "";
        this.formInline.goodsTypeId = "";
        this.formInline.customizeStatus = "";
      },
      //获取列表长度
      getLength(v) {
        if (v == null || v.length == 0) {
          return 0;
        } else {
          return v.length;
        }
      },
      //修改定制状态
      updateCustomizeStatus(v, status) {
        let data = {
          goodsId: v.uuid,
          customizeStatus: status
        };
        updateCustomizeStatus(data).then(res => {
          if (res.code == 1) {
            this.$message({
              showClose: true,
              message: res.message,
              type: "success"
            });
          } else {
            this.$message({
              showClose: true,
              message: res.message,
              type: "error"
            });
          }
          this.queryCustomizeGoodsAllList();
        });
      },
      //删除定制商品
      deleteCustomizeGoods(v, status) {
        let data = {
          goodsId: v.uuid
        };
        deleteCustomizeGoods(data).then(res => {
          if (res.code == 1) {
            this.$message({
              showClose: true,
              message: res.message,
              type: "success"
            });
          } else {
            this.$message({
              showClose: true,
              message: res.message,
              type: "error"
            });
          }
          if (this.listQuery.current > 1 && (this.listQuery.current - 1) * this.listQuery.size >= (this.total -
            1)) {
            this.listQuery.current -= 1;
          }
          this.queryCustomizeGoodsAllList();
        });
      },
      //显示挑选商品弹窗
      showGoodsDialog() {
        this.queryChooseGoodsList();
        this.insertGoodsDialogVisible = true;
      },
      //关闭挑选商品弹窗
      closeGoodsDialog() {
        this.insertGoodsDialogVisible = false;
      },
      //挑选商品列表
      queryChooseGoodsList() {
        let data = {
          current: this.listQuery2.current,
          size: this.listQuery2.size,
          condition: {
            goodsName: this.formInline2.goodsName.trim(),
            goodsTypeId: this.formInline2.goodsTypeId
          },
          ascs: [],
          descs: []
        };
        queryChooseGoodsList(data).then(res => {
          this.loading2 = false;
          this.chooseData = res.records;
          this.total2 = res.total;
        });
      },
      handleSizeChange2(val) {
        this.listQuery2.size = val;
        this.queryChooseGoodsList();
      },
      handleCurrentChange2(val) {
        this.listQuery2.current = val;
        this.queryChooseGoodsList();
      },
      //查询
      search2() {
        this.listQuery2.current = 1;
        this.queryChooseGoodsList();
      },
      //重置
      kong2() {
        this.formInline2.goodsName = "";
        this.formInline2.goodsTypeId = "";
      },
      //监听选择器
      handleSelectionChange(val) {
        this.batchSelGoods = val;
      },
      //添加定制商品
      insertCustomizeGoods() {
        if (this.batchSelGoods.length == 0) {
          this.$message({
            showClose: true,
            message: "请先挑选纳入定制的商品",
            type: "info"
          });
          return false;
        }
        var goodsList = [];
        for (let index = 0; index < this.batchSelGoods.length; index++) {
          let row = this.batchSelGoods[index];
          goodsList.push(row.uuid);
        }
        let data = {
          goodsList: goodsList
        };
        batchInsertCustomizeGoods(data).then(res => {
          if (res.code == 1) {
            this.$message({
              showClose: true,
              message: res.message,
              type: "success"
            });
          } else {
            this.$message({
              showClose: true,
              message: res.message,
              type: "error"
            });
          }
          this.queryChooseGoodsList();
          this.queryCustomizeGoodsAllList();
          this.closeGoodsDialog();
        });
      },
      //显示上传弹窗
      showUploadPicDialog(v) {
        this.picGoodsId = v.uuid;
        var pictures = v.picList;
        this.picList = [];
        if (pictures !== undefined && pictures != null && pictures.length > 0) {
          pictures.forEach((item, i) => {
            if (item != null) {
              var picId = item.picId;
              var picUrl = item.picUrl;
              var index = picUrl.lastIndexOf(".");
              var picName = picUrl.substring(index - 5, picUrl.length);
              let data = {
                picId: picId,
                url: picUrl,
                name: picName,
                picType: 4
              };
              this.picList.push(data);
            }
          });
        }
        this.uploadPicDialogVisible = true;
      },
      //关闭上传弹窗
      closeUploadPicDialog() {
        this.uploadPicDialogVisible = false;
        this.picList = [];
      },
      //预览图片
      handlePreview(file) {
        this.dialogImageUrl = file.url;
        this.dialogVisibleImg = true;
      },
      //删除图片
      handleRemove(file, fileList) {
        let newfileList = [];
        fileList.forEach((item, i) => {
          let data = {
            picId: item.picId,
            url: item.url,
            name: item.name,
            picType: 4
          };
          newfileList.push(data);
        });
        this.picList = newfileList;
      },
      //上传图片
      upLoadPic(file, fileList) {
        var picUrl = file.result;
        var name = fileList.name;
        let data = {
          picId: "",
          url: picUrl,
          name: name,
          picType: 4
        };
        this.picList.push(data);
      },
      //添加图片
      insertPictures() {
        if (this.picList == undefined || this.picList.length <= 0) {
          this.$message.error("请先上传图片");
          return;
        }
        var pictures = [];
        this.picList.forEach((item, i) => {
          if (item != null) {
            var picId = item.picId;
            var picUrl = item.url;
            let picItem = {
              picId: picId,
              picUrl: picUrl,
              picType: 4
            };
            pictures.push(picItem);
          }
        });
        let data = {
          goodsId: this.picGoodsId,
          picList: pictures
        };
        insertCustomizePictures(data).then(res => {
          if (res.code == 1) {
            this.$message({
              showClose: true,
              message: res.message,
              type: "success"
            });
          } else {
            this.$message({
              showClose: true,
              message: res.message,
              type: "error"
            });
          }
          this.queryCustomizeGoodsAllList();
          this.closeUploadPicDialog();
        });
      },
      //显示定制价格弹窗
      showCustomizePriceDialog(v) {
        this.customizePriceDialogVisible = true;
        this.$refs['ruleForm'].resetFields();
        this.priceGoodsId = v.uuid;
        this.priceGoodsUnit = v.unitName;
        let price = v.customizePrice != null && !isNaN(v.customizePrice) ? v.customizePrice.toFixed(2) : null;
        this.ruleForm.customizePrice = price;
      },
      //关闭定制价格弹窗
      closeCustomizePriceDialog() {
        this.customizePriceDialogVisible = false;
      },
      //定制价格调整
      customizePriceCheck() {
        let val = this.ruleForm.customizePrice;
        if (val != null && !isNaN(val)) {
          this.ruleForm.customizePrice = parseFloat(val).toFixed(2);
        }
        return true;
      },
      //定制价格保存
      saveCustomizePrice() {
        this.$refs['ruleForm'].validate((valid) => {
          if (valid) {
            let data = {
              goodsId: this.priceGoodsId,
              customizePrice: this.ruleForm.customizePrice
            };
            saveCustomizePrice(data).then(res => {
              if (res.code == 1) {
                this.$message({
                  showClose: true,
                  message: res.message,
                  type: "success"
                });
              } else {
                this.$message({
                  showClose: true,
                  message: res.message,
                  type: "error"
                });
              }
              this.queryCustomizeGoodsAllList();
              this.closeCustomizePriceDialog();
            });
          } else {
            return false;
          }
        });
      }
    }
  };
</script>
<style>
  .el-dialog__body {
    padding-top: 0;
  }
</style>
